package com.lyltim.demo.mapper;

import com.lyltim.demo.bean.Order;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository
public interface OrderMapper {
    public void insertOrder (Order order);

    @Select("select * from orders where id=#{id}")
    public Order getOrderById(long id);

    @Select("select * from orders")
    public List<Order> getOrders();

    @Delete("delete from orders where id=#{id} ")
    public void deleteOrderById(long id);
}
